{% block field_row %}
    <div class="form_row">
        {{ form_label(form) }}
        {{ form_widget(form) }}
        {{ form_errors(form) }}
        <div class="clearfix"></div>
    </div>
{% endblock field_row %}

{% block repeated_row %}
{% spaceless %}
    {% set i = 0 %}
    {% for child in form %}
        <div class="form_row">
            {{ form_label(child) }}
            {{ form_widget(child) }}
            {% if i == 0 %}
                {{ form_errors(form) }}
                {% set i = i + 1 %}
            {% endif %}
            <div class="clearfix"></div>
        </div>
    {% endfor %}
{% endspaceless %}
{% endblock repeated_row %}

{% block field_errors %}
{% spaceless %}
    {% if errors|length > 0 %}
    <ul class="errors">
        {% for error in errors %}
            <li>{{ error.messageTemplate|trans(error.messageParameters, 'validators') }}</li>
        {% endfor %}
    </ul>
    {% endif %}
{% endspaceless %}
{% endblock field_errors %}

{% block choice_widget %}
{% spaceless %}
    {% if expanded %}
        <div class="options" {{ block('widget_container_attributes') }}>
        {% for child in form %}
            <div>
            {{ form_widget(child) }}
            {{ form_label(child) }}
            </div>
        {% endfor %}
        <div class="clearfix"></div>
        </div>
    {% else %}
    <select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
        {% if empty_value is not none %}
            <option value="">{{ empty_value|trans }}</option>
        {% endif %}
        {% if preferred_choices|length > 0 %}
            {% set options = preferred_choices %}
            {{ block('widget_choice_options') }}
            {% if choices|length > 0 and separator is not none %}
                <option disabled="disabled">{{ separator }}</option>
            {% endif %}
        {% endif %}
        {% set options = choices %}
        {{ block('widget_choice_options') }}
    </select>
    {% endif %}
{% endspaceless %}
{% endblock choice_widget %}
